home *** CD-ROM | disk | FTP | other *** search
/ Aminet 34 / Aminet 34 (2000)(Schatztruhe)[!][Dec 1999].iso / Aminet / util / misc / DelfInit.lha / DelfInit / Install < prev    next >
Encoding:
Text File  |  1999-08-30  |  10.9 KB  |  278 lines

  1. ;-----------------------------------------------------------------------------
  2. ; TITLE        : Install
  3. ; VERSION      : 1.0
  4. ; DATE         : 28.08.1999
  5. ; DESCRIPTION  : Installer script for DelfInit
  6. ; INPUT        : -
  7. ; OUTPUT       : -
  8. ;-----------------------------------------------------------------------------
  9. ; MODIFICATIONS: -
  10. ;-----------------------------------------------------------------------------
  11. ; LIMITATIONS AND BUGS
  12. ; 28.08.1999 Limitation
  13. ;  Doesn't install DelfInit command call to the user-startup file
  14. ;-----------------------------------------------------------------------------
  15.  
  16. ; $VER: Install 1.0 (28.08.1999)
  17.  
  18. ;-----------------------------------------------------------------------------
  19. ; VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIA
  20. ;-----------------------------------------------------------------------------
  21. (set #config_ok 1)                       ; Default: configuration is ok
  22. (set #cpu "???(20|30|40|60)")            ; Required CPU
  23. (set #installer_ver 43)                  ; Minimum Installer version
  24. (set #installer_rev 3)                   ; Minimum Installer revision
  25. (set #os_ver 40)                         ; Minimum OS version
  26. (set #os_rev 10)                         ; Minimum OS revision
  27. (set #appsize 1000000)                   ; Required diskspace for application
  28.                                          ; (bytes)
  29. (set #configcheckmask %001)              ; Configuration check mask:
  30.                                          ; bit0 (right)  = cpu
  31.                                          ; bit1 (middle) = os version
  32.                                          ; bit2 (left)   = disk space
  33. (set #application "DelfInit")            ; Application
  34.  
  35. ; Default language (English)
  36. (set #string1 ("\nInstaller version %ld.%ld required.\nPlease check your configuration." #installer_ver #installer_rev))
  37. (set #string2 ("\n%s\n\nCopyright © 1999 Janne Peräaho.\nAll Rights Reserved." #application))
  38. (set #string3 ("\n%s has now been installed.\nRead DelfInit.guide for instructions how to autoinitialize Delfina." #application))
  39. (set #string4 "\nAt least 68020 CPU, Installer version 43.3 and delfina.library required.\n\nPlease check your configuration.")
  40. (set #string5 "\nSelect components to be installed.")
  41. (set #string50 "\nSOFTWARE COMPONENTS\n\nDelfInit package consists of binary executable (DelfInit) and Amiga guide documentation (DelfInit.guide).\n\nIn this section you may select the prefered software components to be installed.")
  42. (set #string51 "DelfInit      (about  6 kB)")
  43. (set #string52 "Documentation (about 10 kB)")
  44. (set #string60 "\nSelect target directory for DelfInit (Delfina/bin directory recommended).")
  45. (set #string61 "\nINSTALLING DELFINIT\n\nDelfInit command will be copied to the selected directory.")
  46. (set #string62 "C:Delfina/bin/")
  47. (set #string63 "\nSelect target directory for DelfInit documentation (Delfina/Docs directory recommended).")
  48. (set #string64 "\nINSTALLING DELFINIT DOCUMENTATION\n\nDelfInit.guide and it's icon will be copied to the selected directory.")
  49. (set #string65 "C:Delfina/Docs")
  50. (set #string70 "\nInstalling DelfInit...")
  51. (set #string71 "\nINSTALLING DELFINIT\n\nDelfInit command will be copied into the target directory.")
  52. (set #string72 "DelfInit")
  53. (set #string73 "#?")
  54. (set #string74 "\nInstalling DelfInit documentation...")
  55. (set #string75 "\nINSTALLING DOCUMENTATION\n\nDelfInit.guide and DelfInit.guide.info will be copied into the target directory.")
  56. (set #string76 "")
  57. (set #string77 "DelfInit(.guide|.guide.info)")
  58.  
  59. ; Finnish language
  60. (if (= @language "suomi")
  61.    (
  62.       (set #string1 ("\nAsennukseen tarvitaan Installer-ohjelman versio %ld.%ld." #installer_ver #installer_rev))
  63.       (set #string2 ("\n%s\n\nOhjelmiston oikeudet © 1999 omistaa Janne Peräaho.\nKaikki oikeudet pidätetään." #application))
  64.       (set #string3 ("\n%s on nyt asennettu.\nJos haluat aktivoida Delfinan automaattisesti jokaisen käynnistyksen yhteydessä, lue asennusohjeet DelfInit-dokumentaatiosta (DelfInit.guide)." #application))
  65.       (set #string4 "\nDelfInit vaatii vähintään 68020 CPU:n, Installer (versio 43.3) -ohjelman ja delfina-kirjaston.")
  66.       (set #string5 "\nValitse ne ohjelmiston osat, jotka haluat asentaa.")
  67.       (set #string50 "\nOHJELMISTON OSAT\n\nDelfInit-paketti koostuu ajokelpoisesta binääritiedostosta (DelfInit) ja Amiga guide -formaatissa olevasta dokumentaatiosta (DelfInit.guide).\n\nVoit valita haluamasi ohjelmiston osat, jotka asennetaan.")
  68.       (set #string51 "DelfInit      (noin  6 kt)")
  69.       (set #string52 "Dokumentaatio (noin 10 kt)")
  70.       (set #string60 "\nValitse kohdehakemisto DelfInit-ohjelmalle (suositus: Delfina/bin-hakemisto).")
  71.       (set #string61 "\nDELFINIT:N ASENNUS\n\nDelfInit-komento kopioidaan valittuun hakemistoon.")
  72.       (set #string62 "C:Delfina/bin/")
  73.       (set #string63 "\nValitse kohdehakemisto DelfInit-dokumentaatiolle (suositus: Delfina/Docs-hakemisto).")
  74.       (set #string64 "\nDELFINIT-DOKUMENTAATION ASENNUS\n\nDelfInit.guide ja sen ikoni kopioidaan valittuun hakemistoon.")
  75.       (set #string65 "C:Delfina/Docs")
  76.       (set #string70 "\nDelfInit:n asennus...")
  77.       (set #string71 "\nDELFINIT:N ASENNUS\n\nDelfInit-komento kopioidaan kohdehakemistoon.")
  78.       (set #string72 "DelfInit")
  79.       (set #string73 "#?")
  80.       (set #string74 "\nDelfInit-dokumentaation asennus...")
  81.       (set #string75 "\nDOKUMENTAATION ASENNUS\n\nDelfInit.guide ja DelfInit.guide.info kopioidaan kohdehakemistoon.")
  82.       (set #string76 "")
  83.       (set #string77 "DelfInit(.guide|.guide.info)")
  84.    )
  85. ); if
  86.  
  87. ;-----------------------------------------------------------------------------
  88. ; SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUB
  89. ;-----------------------------------------------------------------------------
  90. ;-----------------------------------------------------------------------------
  91. ; TITLE        : p_DecodeVersion
  92. ; VERSION      : 0.10
  93. ; DATE         : 30.08.1998
  94. ; DESCRIPTION  : Get version and revision from raw version number
  95. ; INPUT        : #version - raw version number
  96. ; OUTPUT       : #ver     - version number
  97. ;                #rev     - revision number
  98. ;-----------------------------------------------------------------------------
  99. ; MODIFICATIONS: -
  100. ;-----------------------------------------------------------------------------
  101. (procedure p_DecodeVersion #version
  102.    (set #ver (/ #version 65536))
  103.    (set #rev (- #version (* #ver 65536)))
  104. )
  105.  
  106. ;-----------------------------------------------------------------------------
  107. ; TITLE        : p_EncodeVersion
  108. ; VERSION      : 0.10
  109. ; DATE         : 30.08.1998
  110. ; DESCRIPTION  : Create raw version number from version and revision number
  111. ; INPUT        : #ver     - version number
  112. ;                #rev     - revision number
  113. ; OUTPUT       : #version - raw version number
  114. ;-----------------------------------------------------------------------------
  115. ; MODIFICATIONS: -
  116. ;-----------------------------------------------------------------------------
  117. (procedure p_EncodeVersion #ver #rev
  118.    (set #version (+ (* #ver 65536) #rev))
  119. )
  120.  
  121. ;-----------------------------------------------------------------------------
  122. ; TITLE        : p_CheckConfiguration
  123. ; VERSION      : 0.10
  124. ; DATE         : 30.08.1998
  125. ; DESCRIPTION  : Check if requirements match with current configuration
  126. ; INPUT        : -
  127. ; OUTPUT       : #config_ok - 0=not ok, 1=ok
  128. ;-----------------------------------------------------------------------------
  129. ; MODIFICATIONS: -
  130. ;-----------------------------------------------------------------------------
  131. (procedure p_CheckConfiguration
  132.  
  133.    ; Variables
  134.    (set #config_ok 1)
  135.  
  136.    ; Check CPU
  137.    (if (in #configcheckmask 0)
  138.       (
  139.          (if (not (patmatch #cpu (database "cpu")))
  140.             (
  141.                (set #config_ok 0)
  142.             )
  143.          ); if
  144.       )
  145.    ); if
  146.  
  147.    ; Check OS version
  148.    (if (in #configcheckmask 1)
  149.       (
  150.          (p_EncodeVersion #os_ver #os_rev)
  151.          (if (< #version (getversion))
  152.             (set #config_ok 0)
  153.          ); if
  154.       )
  155.    ); if
  156.  
  157.    ; Check diskspace
  158.    (if (in #configcheckmask 2)
  159.       (
  160.          (set #availdspace (getdiskspace @default-dest))
  161.          ; Information not available
  162.          (if (not (< #availdspace 0))
  163.             ; Not enough room
  164.             (if (< #availdspace #appsize)
  165.                (set #config_ok 0)
  166.             ); if
  167.          ); if
  168.       )
  169.    ); if
  170.  
  171. ); p_CheckConfiguration
  172.  
  173. ;-----------------------------------------------------------------------------
  174. ; TITLE        : p_GetDestination
  175. ; VERSION      : 0.10
  176. ; DATE         : 30.08.1998
  177. ; DESCRIPTION  : Get destination directory
  178. ; INPUT        : -
  179. ; OUTPUT       : @default-dest
  180. ;-----------------------------------------------------------------------------
  181. ; MODIFICATIONS: -
  182. ;-----------------------------------------------------------------------------
  183. (procedure p_GetDestination #d1string #d2string #d3string
  184.  
  185.    (set @default-dest
  186.       (askdir
  187.          (prompt #d1string)
  188.          (help #d2string)
  189.          (default #d3string)
  190.          (disk)
  191.       ); askdir
  192.    )
  193. ); p_GetDestination
  194.  
  195. ;-----------------------------------------------------------------------------
  196. ; TITLE        : p_CopyFiles
  197. ; VERSION      : 0.10
  198. ; DATE         : 30.08.1998
  199. ; DESCRIPTION  : Copy files
  200. ; INPUT        : -
  201. ; OUTPUT       : -
  202. ;-----------------------------------------------------------------------------
  203. ; MODIFICATIONS: -
  204. ;-----------------------------------------------------------------------------
  205. (procedure p_CopyFiles #c1string #c2string #c3string #c4string
  206.  
  207.    (copyfiles
  208.       (prompt #c1string)
  209.       (help #c2string)
  210.       (source #c3string)
  211.       (dest @default-dest)
  212.       (pattern #c4string)
  213.       (optional "force")
  214.    ); copyfiles
  215.  
  216. ); p_CopyFiles
  217.  
  218. ;-----------------------------------------------------------------------------
  219. ; MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN
  220. ;-----------------------------------------------------------------------------
  221. ; Welcome message
  222. (welcome #string2)
  223.  
  224. ; Check Installer version
  225. (p_EncodeVersion #installer_ver #installer_rev)
  226. (if (< @installer-version #version)
  227.    (
  228.       (exit #string1 (quiet))
  229.    )
  230. ); if
  231.  
  232. ; Ask options
  233. (set #installoptions
  234.    (askoptions
  235.       (prompt #string5)
  236.       (help #string50)
  237.       (choices #string51 #string52)
  238.       (default %11)
  239.    ); askoptions
  240. )
  241.  
  242. ; First option (#string51)
  243. (if (in #installoptions 0)
  244.    (
  245.       ; Get destination directory
  246.       (p_GetDestination #string60 #string61 #string62)
  247.  
  248.       ; Check configuration
  249.       (p_CheckConfiguration)
  250.       (if (< #config_ok 1)
  251.          (exit #string4 (quiet))
  252.       ); if
  253.  
  254.       ; Copy files
  255.       (p_CopyFiles #string70 #string71 #string72 #string73)
  256.    )
  257. ); if
  258.  
  259. ; Second option (#string52)
  260. (if (in #installoptions 1)
  261.    (
  262.       ; Get destination directory
  263.       (p_GetDestination #string63 #string64 #string65)
  264.  
  265.       ; Check configuration
  266.       (p_CheckConfiguration)
  267.       (if (< #config_ok 1)
  268.          (exit #string4 (quiet))
  269.       ); if
  270.  
  271.       ; Copy files
  272.       (p_CopyFiles #string74 #string75 #string76 #string77)
  273.    )
  274. ); if
  275.  
  276. ; All done
  277. (exit #string3 (quiet))
  278.